home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Source.bin / MonthSpinnerBeanInfo.java < prev    next >
Text File  |  1998-08-21  |  3KB  |  83 lines

  1. package symantec.itools.awt.util.spinner;
  2.  
  3. import java.beans.*;
  4. import symantec.itools.beans.*;
  5. import java.util.ResourceBundle;
  6.  
  7. //  09/11/97    LAB    Removed redundant information.
  8. //  08/19/98    LAB    Moved to GroupAWTAdditions folder.
  9.  
  10. /**
  11.  * BeanInfo for MonthSpinner.
  12.  *
  13.  */
  14. public class MonthSpinnerBeanInfo extends SimpleBeanInfo {
  15.  
  16.     /**
  17.      * Constructs a MonthSpinnerBeanInfo object.
  18.      */
  19.     public MonthSpinnerBeanInfo() {
  20.     }
  21.  
  22.     /**
  23.      * Gets a BeanInfo for the superclass of this bean.
  24.      * @return BeanInfo[] containing this bean's superclass BeanInfo
  25.      */
  26.     public BeanInfo[] getAdditionalBeanInfo() {
  27.         try {
  28.             BeanInfo[] bi = new BeanInfo[1];
  29.             bi[0] = Introspector.getBeanInfo(beanClass.getSuperclass());
  30.             return bi;
  31.         }
  32.         catch (IntrospectionException e) { throw new Error(e.toString());}
  33.     }
  34.  
  35.     /**
  36.      * Gets the SymantecBeanDescriptor for this bean.
  37.      * @return an object of type SymantecBeanDescriptor
  38.      * @see symantec.itools.beans.SymantecBeanDescriptor
  39.      */
  40.     public BeanDescriptor getBeanDescriptor() {
  41.         ResourceBundle group = ResourceBundle.getBundle("symantec.itools.resources.GroupBundle");
  42.         String s=group.getString("GroupAWTAdditions"); 
  43.  
  44.         SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
  45.         bd.setCanAddChild(false);
  46.         bd.setFolder(s);
  47.         bd.setWinHelp("0x123A3");
  48.  
  49.         bd.addAdditionalConnections(getAdditionalBeanInfo());
  50.  
  51.         return (BeanDescriptor) bd;
  52.     }
  53.  
  54.     /**
  55.      * Gets an image that may be used to visually represent this bean
  56.      * (in the toolbar, on a form, etc).
  57.      * @param iconKind the type of icon desired, one of: BeanInfo.ICON_MONO_16x16,
  58.      * BeanInfo.ICON_COLOR_16x16, BeanInfo.ICON_MONO_32x32, or BeanInfo.ICON_COLOR_32x32.
  59.      * @return an image for this bean, always color even if requested monochrome
  60.      * @see BeanInfo#ICON_MONO_16x16
  61.      * @see BeanInfo#ICON_COLOR_16x16
  62.      * @see BeanInfo#ICON_MONO_32x32
  63.      * @see BeanInfo#ICON_COLOR_32x32
  64.      */
  65.     public java.awt.Image getIcon(int iconKind) {
  66.         if (iconKind == BeanInfo.ICON_MONO_16x16 ||
  67.             iconKind == BeanInfo.ICON_COLOR_16x16) {
  68.             java.awt.Image img = loadImage("MonthSpinnerC16.gif");
  69.             return img;
  70.         }
  71.  
  72.         if (iconKind == BeanInfo.ICON_MONO_32x32 ||
  73.             iconKind == BeanInfo.ICON_COLOR_32x32) {
  74.             java.awt.Image img = loadImage("MonthSpinnerC32.gif");
  75.             return img;
  76.         }
  77.  
  78.         return null;
  79.     }
  80.  
  81.     private final static Class beanClass = MonthSpinner.class;
  82.  
  83.     }    //  end of class MonthSpinnerBeanInfo